package com.zoe.onelink.core.util.http;

import com.zoe.onelink.core.util.http.model.HttpClientEntity;
import com.zoe.onelink.core.util.http.model.HttpClientResponse;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2022</p>
 * <p>公司: 智业软件股份有限公司</p>
 *
 * @version: 1.0
 * @author: ruansheng
 * @date: 2022-05-20
 */
public interface HttpClientInterceptor {

    /**
     * 请求执行前调用
     *
     * @param async  是否异步
     * @param entity 请求参数
     */
    void beforeRequest(boolean async, HttpClientEntity entity);

    /**
     * 请求执行完成后调用
     *
     * @param async    是否异步
     * @param entity   请求参数
     * @param response 返回结果
     */
    <R> void afterRequest(boolean async, HttpClientEntity entity, HttpClientResponse<R> response);

}
